package com.meilai.project.service.business.sale.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.meilai.project.entity.business.sale.BillSaleProxy;
import com.meilai.project.mapper.business.sale.BillSaleProxyMapper;
import com.meilai.project.service.business.sale.BillSaleProxyService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author xchen
 * @since 2022-03-19
 */
@Service
public class BillSaleProxyServiceImpl extends ServiceImpl<BillSaleProxyMapper, BillSaleProxy> implements BillSaleProxyService {

    @Override
    public int deleteByBillSaleId(Long bill_sale_id) {
        return baseMapper.deleteByBillSaleId(bill_sale_id);
    }

    @Override
    public List<BillSaleProxy> selectByBillSaleId(Long bill_sale_id) {
        return baseMapper.selectByBillSaleId(bill_sale_id);
    }

    @Override
    public Map<Long, List<BillSaleProxy>> selectByBillSaleIds(List<Long> bill_sale_ids) {
        return baseMapper.selectByBillSaleIds(bill_sale_ids).stream().collect(Collectors.groupingBy(BillSaleProxy::getBill_sale_id));
    }
}
